<!doctype html><html lang=en-us dir=ltr><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="Snap # 如果Ubuntu有问题,那么很有可能是因为Snap
Firefox # 在升级Ubuntu 24.04后内存占用极为不正常, 多次排查无果, 增加了交换空间还是没有治本, 几经排查终于发现是firefox的问题, 且是Snap的firefox的问题,所以手动下载别的版本后修改如下:
修改/usr/bin/firefox中的最一开始的监测安装和运行为自行下载软件路径 添加gnome favorite-apps 1. 添加Firefox到Favorites（喜爱应用） # 打开终端（Ctrl + Alt + T）。 输入以下命令来查看当前的喜爱应用列表： gsettings get org.gnome.shell favorite-apps 这会输出当前的喜爱应用列表 3. 如果没有看到 firefox.desktop 在列表中，可以使用以下命令将它添加进去,这个命令会将 firefox.desktop 添加到喜爱应用列表的末尾。：
gsettings set org.gnome.shell favorite-apps &#34;$(gsettings get org.gnome.shell favorite-apps | sed &#34;s/]/, 'firefox.desktop']/&#34;)&#34; 2. 检查.desktop文件是否正确 # 确保 firefox.desktop 文件存在并且正确配置。通常，它应该位于 /usr/share/applications/ 目录或者在Snap安装中可能位于 /var/lib/snapd/desktop/applications/ 目录。你可以使用 ls 命令检查这些位置是否有相关的 .desktop 文件：
ls /usr/share/applications/firefox.desktop ls /var/lib/snapd/desktop/applications/firefox_firefox.desktop # 如果是通过Snap安装的Firefox` 3. 更新缓存和重启(可选) - 我用的 [[#^bef1ba]] # 如果以上步骤没有解决问题，尝试更新GNOME的缓存并重新启动GNOME Shell："><meta name=theme-color content="#FFFFFF"><meta name=color-scheme content="light dark"><meta property="og:title" content="Ubuntu"><meta property="og:description" content="Snap # 如果Ubuntu有问题,那么很有可能是因为Snap
Firefox # 在升级Ubuntu 24.04后内存占用极为不正常, 多次排查无果, 增加了交换空间还是没有治本, 几经排查终于发现是firefox的问题, 且是Snap的firefox的问题,所以手动下载别的版本后修改如下:
修改/usr/bin/firefox中的最一开始的监测安装和运行为自行下载软件路径 添加gnome favorite-apps 1. 添加Firefox到Favorites（喜爱应用） # 打开终端（Ctrl + Alt + T）。 输入以下命令来查看当前的喜爱应用列表： gsettings get org.gnome.shell favorite-apps 这会输出当前的喜爱应用列表 3. 如果没有看到 firefox.desktop 在列表中，可以使用以下命令将它添加进去,这个命令会将 firefox.desktop 添加到喜爱应用列表的末尾。：
gsettings set org.gnome.shell favorite-apps &#34;$(gsettings get org.gnome.shell favorite-apps | sed &#34;s/]/, 'firefox.desktop']/&#34;)&#34; 2. 检查.desktop文件是否正确 # 确保 firefox.desktop 文件存在并且正确配置。通常，它应该位于 /usr/share/applications/ 目录或者在Snap安装中可能位于 /var/lib/snapd/desktop/applications/ 目录。你可以使用 ls 命令检查这些位置是否有相关的 .desktop 文件：
ls /usr/share/applications/firefox.desktop ls /var/lib/snapd/desktop/applications/firefox_firefox.desktop # 如果是通过Snap安装的Firefox` 3. 更新缓存和重启(可选) - 我用的 [[#^bef1ba]] # 如果以上步骤没有解决问题，尝试更新GNOME的缓存并重新启动GNOME Shell："><meta property="og:type" content="article"><meta property="og:url" content="http://example.org/docs/programmer/platforms/ubuntu/"><meta property="article:section" content="docs"><meta property="article:published_time" content="2024-06-17T00:00:00+00:00"><meta property="article:modified_time" content="2024-06-17T00:00:00+00:00"><title>Ubuntu | Ian's Blog</title>
<link rel=manifest href=/manifest.json><link rel=icon href=/favicon.png type=image/x-icon><link rel=stylesheet href=/book.min.c58292d36b18b675680ab9baea2029204537b839ea72f258746ec0f32ce8d6c8.css integrity="sha256-xYKS02sYtnVoCrm66iApIEU3uDnqcvJYdG7A8yzo1sg=" crossorigin=anonymous><script defer src=/flexsearch.min.js></script><script defer src=/en.search.min.80b0c12c6a3982c23bab5eb1d10c75b4cf8bfbaa1c7e183729648ce8a09207d7.js integrity="sha256-gLDBLGo5gsI7q16x0Qx1tM+L+6ocfhg3KWSM6KCSB9c=" crossorigin=anonymous></script></head><body dir=ltr><input type=checkbox class="hidden toggle" id=menu-control>
<input type=checkbox class="hidden toggle" id=toc-control><main class="container flex"><aside class=book-menu><div class=book-menu-content><nav><h2 class=book-brand><a class="flex align-center" href=/><span>Ian's Blog</span></a></h2><div class=book-search><input type=text id=book-search-input placeholder=Search aria-label=Search maxlength=64 data-hotkeys=s/><div class="book-search-spinner hidden"></div><ul id=book-search-results></ul></div><ul><li class=book-section-flat><a href=/docs/programmer/>程序员笔记</a><ul><li><input type=checkbox id=section-d5f99046a51e5e750b61f2e037945fcc class=toggle>
<label for=section-d5f99046a51e5e750b61f2e037945fcc class="flex justify-between"><a role=button>基础工具和配置</a></label><ul><li><a href=/docs/programmer/basetc/%E6%96%87%E6%9C%AC%E4%B8%89%E5%89%91%E5%AE%A2/>文本三剑客</a></li><li><a href=/docs/programmer/basetc/tmux/>Tmux使用笔记</a></li><li><a href=/docs/programmer/basetc/obsidian%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE%E6%8F%92%E4%BB%B6/>Obsidian思维导图插件</a></li><li><a href=/docs/programmer/basetc/for_china/>各个软件换源</a></li><li><a href=/docs/programmer/basetc/tipsofvim/>tip Of vim</a></li><li><a href=/docs/programmer/basetc/editer/>编辑器使用</a></li><li><a href=/docs/programmer/basetc/bash/>Bash</a></li><li><a href=/docs/programmer/basetc/gitbook/>Gitbook</a></li><li><a href=/docs/programmer/basetc/vim/>Vim</a></li><li><a href=/docs/programmer/basetc/%E5%AE%88%E6%8A%A4%E8%BF%9B%E7%A8%8B/>supervisor</a></li></ul></li><li><input type=checkbox id=section-8658298e10b544e890095f646916165a class=toggle>
<label for=section-8658298e10b544e890095f646916165a class="flex justify-between"><a href=/docs/programmer/cloudnative/>云原生</a></label><ul><li><input type=checkbox id=section-31d3b02fd4a132635e483e7e756058ea class=toggle>
<label for=section-31d3b02fd4a132635e483e7e756058ea class="flex justify-between"><a href=/docs/programmer/cloudnative/redis/>中间件</a></label><ul><li><a href=/docs/programmer/cloudnative/redis/python-redis-%E5%AE%A2%E6%88%B7%E7%AB%AF/>Python Redis 客户端</a></li><li><a href=/docs/programmer/cloudnative/redis/bigkey-and-hotkey/>大key、热key问题</a></li><li><a href=/docs/programmer/cloudnative/redis/the-basics-of-redis/>Redis基础</a></li><li><a href=/docs/programmer/cloudnative/redis/advanced-knowledge-of-redis/>Redis进阶</a></li><li><a href=/docs/programmer/cloudnative/redis/%E4%BD%BF%E7%94%A8%E5%91%BD%E4%BB%A4/>Redis常用命令</a></li></ul></li><li><input type=checkbox id=section-62d608ed890b3abc76dae78ccfcab912 class=toggle>
<label for=section-62d608ed890b3abc76dae78ccfcab912 class="flex justify-between"><a role=button>k8s</a></label><ul><li><a href=/docs/programmer/cloudnative/k8s/elk%E5%9C%A8k8s%E4%B8%8A%E7%9A%84%E9%83%A8%E7%BD%B2%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B/>elk在k8s上的部署使用示例</a></li><li><a href=/docs/programmer/cloudnative/k8s/k8s-%E9%85%8D%E5%A5%97%E8%AF%B4%E6%98%8E/>k8s 配套说明</a></li><li><a href=/docs/programmer/cloudnative/k8s/k8s-%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/>k8s技术分享</a></li><li><a href=/docs/programmer/cloudnative/k8s/k8s%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E5%92%8C%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E8%A7%A3%E6%9E%90/>k8s学习-常用命令和配置文件</a></li><li><a href=/docs/programmer/cloudnative/k8s/argo-workflow%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E5%92%8C%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF%E5%88%86%E6%9E%90/>Argo Workflow性能测试和使用场景分析</a></li><li><a href=/docs/programmer/cloudnative/k8s/argo-%E4%BD%BF%E7%94%A8%E8%AE%B0%E5%BD%95/>Argo 使用记录</a></li></ul></li><li><input type=checkbox id=section-b828bf3d116bc282da9db25a06bf908e class=toggle>
<label for=section-b828bf3d116bc282da9db25a06bf908e class="flex justify-between"><a role=button>中间件</a></label><ul><li><a href=/docs/programmer/cloudnative/middleware/kafka-%E5%AE%89%E8%A3%85%E5%92%8C%E4%BD%BF%E7%94%A8/>Kafka 安装和使用</a></li></ul></li><li><a href=/docs/programmer/cloudnative/%E5%AE%B9%E5%99%A8/note-of-podman/>Podman</a></li><li><a href=/docs/programmer/cloudnative/nginx%E5%AE%9E%E7%94%A8%E9%85%8D%E7%BD%AE/>Nginx实用配置</a></li><li><a href=/docs/programmer/cloudnative/uwsgi-%E5%A4%84%E7%90%86%E8%AE%B0%E5%BD%95/>uwsgi 处理记录</a></li><li><a href=/docs/programmer/cloudnative/note-of-docker/>Docker</a></li><li><a href=/docs/programmer/cloudnative/%E5%AE%B9%E5%99%A8/note-of-docker/>Docker</a></li><li><a href=/docs/programmer/cloudnative/fastapi/>Django的建站的(｡･･)ﾉﾞ</a></li><li><a href=/docs/programmer/cloudnative/nginx-%E9%AB%98%E5%8F%AF%E7%94%A8/>Nginx高可用</a></li><li><a href=/docs/programmer/cloudnative/notesdjango/>Django的建站的(｡･･)ﾉﾞ</a></li><li><a href=/docs/programmer/cloudnative/sonar-%E4%BB%A3%E7%A0%81%E9%9D%99%E6%80%81%E6%A3%80%E6%9F%A5/>Sonar 代码静态检查</a></li></ul></li><li><input type=checkbox id=section-883e27361d38e16afb68faff3435ac0b class=toggle>
<label for=section-883e27361d38e16afb68faff3435ac0b class="flex justify-between"><a role=button>机器学习</a></label><ul><li><a href=/docs/programmer/ml/stable-diffusion/>AI画图</a></li><li><a href=/docs/programmer/ml/%E7%88%AC%E8%99%AB/>爬虫</a></li><li><a href=/docs/programmer/ml/paddle/>Paddle</a></li><li><a href=/docs/programmer/ml/tensorflow/>Tensorflow</a></li><li><a href=/docs/programmer/ml/opencv/>OpenCV</a></li><li><a href=/docs/programmer/ml/yolo/>Demo Test项目中的一些东西</a></li><li><a href=/docs/programmer/ml/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E5%B8%B8%E7%94%A8%E5%BA%93%E5%9F%BA%E6%9C%AC%E7%94%A8%E6%B3%95/>机器学习库</a></li></ul></li><li><input type=checkbox id=section-0bf4f4329214e20fa67ca3e12c6aad0c class=toggle checked>
<label for=section-0bf4f4329214e20fa67ca3e12c6aad0c class="flex justify-between"><a role=button>平台</a></label><ul><li><a href=/docs/programmer/platforms/ubuntu/ class=active>Ubuntu</a></li><li><a href=/docs/programmer/platforms/%E9%98%BF%E9%87%8C%E4%BA%91%E4%BD%BF%E7%94%A8/>阿里云使用</a></li><li><a href=/docs/programmer/platforms/wps-for-linux/>WPS for Linux</a></li><li><a href=/docs/programmer/platforms/appsflyer/>AppsFlyer-外网移动归因营销分析平台</a></li></ul></li><li><input type=checkbox id=section-bf4e0d6f0b81f7b3ec08ed1fc66b874d class=toggle>
<label for=section-bf4e0d6f0b81f7b3ec08ed1fc66b874d class="flex justify-between"><a href=/docs/programmer/langs/>编程语言</a></label><ul><li><input type=checkbox id=section-771df6c720301e69f1715f7fc174ac3d class=toggle>
<label for=section-771df6c720301e69f1715f7fc174ac3d class="flex justify-between"><a role=button>Python</a></label><ul><li><a href=/docs/programmer/langs/python/sqlalchemy/>SqlAlchemy - 数据库Orm</a></li><li><a href=/docs/programmer/langs/python/pypi/>PyPi使用说明</a></li><li><a href=/docs/programmer/langs/python/pytest/>PyTest</a></li><li><a href=/docs/programmer/langs/python/paramiko-%E4%BD%BF%E7%94%A8-sshsftp/>Paramiko 使用 Ssh&amp;sftp</a></li><li><a href=/docs/programmer/langs/python/%E5%A4%9A%E7%BA%BF%E7%A8%8B%E5%A4%9A%E8%BF%9B%E7%A8%8B/>Python 多线程多进程</a></li><li><a href=/docs/programmer/langs/python/notespython/>Python 常用库</a></li><li><a href=/docs/programmer/langs/python/notespython/>Python 笔记</a></li><li><a href=/docs/programmer/langs/python/py%E5%B0%8F%E5%B7%A5%E5%85%B7%E5%92%8C%E5%8A%9F%E8%83%BD%E6%80%A7%E6%96%B9%E6%B3%95/>Py小工具和功能性方法</a></li><li><a href=/docs/programmer/langs/python/notespython/>解决问题</a></li></ul></li><li><input type=checkbox id=section-9f8ac8f06e138c7ac13ff61f23b4d497 class=toggle>
<label for=section-9f8ac8f06e138c7ac13ff61f23b4d497 class="flex justify-between"><a role=button>Golang</a></label><ul><li><a href=/docs/programmer/langs/golang/advanced-knowledge-of-golang/>Golang进阶笔记</a></li><li><a href=/docs/programmer/langs/golang/noteofgoexp/>Golang进阶笔记</a></li><li><a href=/docs/programmer/langs/golang/note-of-golang/>Golang笔记</a></li><li><a href=/docs/programmer/langs/golang/noteofgolang/>Golang笔记</a></li></ul></li><li><a href=/docs/programmer/langs/cmake/>CMake 使用Tips</a></li><li><a href=/docs/programmer/langs/tips-of-debugers/>Tips of debuggers</a></li><li><a href=/docs/programmer/langs/tips-of-markdown/>Tips of MarkDown</a></li><li><a href=/docs/programmer/langs/java/notesjava/>愉快的Java(happy to learn the fuck java)</a></li><li><a href=/docs/programmer/langs/note-for-fmtdata/>数据格式笔记</a></li></ul></li><li><input type=checkbox id=section-de7bfad1d124522974cdf8addfbb23f2 class=toggle>
<label for=section-de7bfad1d124522974cdf8addfbb23f2 class="flex justify-between"><a role=button>Net</a></label><ul><li><a href=/docs/programmer/net/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/>网络编程</a></li><li><a href=/docs/programmer/net/nginx%E5%AE%9E%E7%94%A8%E9%85%8D%E7%BD%AE/>Nginx实用配置</a></li><li><a href=/docs/programmer/net/tips-of-grpc/>gRpc使用小记</a></li><li><a href=/docs/programmer/net/epoll%E5%AE%9E%E7%8E%B0/>Epoll实现</a></li><li><a href=/docs/programmer/net/net/>Epoll实现</a></li></ul></li><li><input type=checkbox id=section-4446dd07527142b855f26d7cc8f0e617 class=toggle>
<label for=section-4446dd07527142b855f26d7cc8f0e617 class="flex justify-between"><a href=/docs/programmer/database/>Database</a></label><ul><li><a href=/docs/programmer/database/mongodb/>Mongodb使用记录</a></li><li><a href=/docs/programmer/database/dgraph/>Dgraph使用小记</a></li><li><a href=/docs/programmer/database/note-of-db-data-mongodb/>数据库-MongoDB篇</a></li><li><a href=/docs/programmer/database/note-of-db-data/>数据库-MongoDB篇</a></li><li><a href=/docs/programmer/database/note-of-db-data-mysql/>数据库-MySQL篇</a></li></ul></li><li><input type=checkbox id=section-7e5360c5e7954906b897ed79085884b6 class=toggle>
<label for=section-7e5360c5e7954906b897ed79085884b6 class="flex justify-between"><a href=/docs/programmer/gui/>图形用户界面-GUI</a></label><ul><li><a href=/docs/programmer/gui/pyinstaller-python%E6%89%93%E5%8C%85/>python打包</a></li><li><a href=/docs/programmer/gui/pyinstaller/>python打包</a></li><li><a href=/docs/programmer/gui/qt/>Qt/PySide</a></li><li><a href=/docs/programmer/gui/noteofvn_py/>Vn.Py学习笔记（Python交易平台框架）</a></li><li><a href=/docs/programmer/gui/vn.py%E7%AC%94%E8%AE%B0-%E4%BA%A4%E6%98%93%E5%B9%B3%E5%8F%B0%E5%AE%A2%E6%88%B7%E7%AB%AF/>Vn.Py学习笔记（Python交易平台框架）</a></li><li><a href=/docs/programmer/gui/notespython/>图形化界面 （Python Gui）</a></li><li><a href=/docs/programmer/gui/notespython/>图形化界面 （Python Gui）</a></li></ul></li><li><input type=checkbox id=section-ddcbe632dc99a9fb372422dada8ee641 class=toggle>
<label for=section-ddcbe632dc99a9fb372422dada8ee641 class="flex justify-between"><a role=button>OS操作系统问题处理</a></label><ul><li><a href=/docs/programmer/os/install_some/>安装问题</a></li><li><a href=/docs/programmer/os/android/>安卓</a></li><li><a href=/docs/programmer/os/freebsd/>FreeBSD</a></li><li><a href=/docs/programmer/os/note-of-linux/>Linux 笔记</a></li><li><a href=/docs/programmer/os/npm/>Npm</a></li><li><a href=/docs/programmer/os/git/>Git</a></li><li><a href=/docs/programmer/os/problem-of-windows/>Windows 爬坑记</a></li><li><a href=/docs/programmer/os/tips-of-problems/>解决问题记录笔记</a></li></ul></li><li><input type=checkbox id=section-d325c59fc6513e1b1e05a60b192d4973 class=toggle>
<label for=section-d325c59fc6513e1b1e05a60b192d4973 class="flex justify-between"><a href=/docs/programmer/hardware/>硬件</a></label><ul><li><a href=/docs/programmer/hardware/raspberrypi/>Raspberry Pi</a></li><li><a href=/docs/programmer/hardware/screen/>Screen</a></li></ul></li></ul></li><li class=book-section-flat><span>建模和游戏</span><ul><li><a href=/docs/3dgame/blender/>Blender</a></li><li><a href=/docs/3dgame/noteofue4/>UE4 笔记</a></li></ul></li><li class=book-section-flat><a href=/docs/example/>Hugo特殊Markdown语法说明</a><ul><li><a href=/docs/example/table-of-contents/>Table of Contents</a><ul><li><a href=/docs/example/table-of-contents/with-toc/>With ToC</a></li><li><a href=/docs/example/table-of-contents/without-toc/>Without ToC</a></li></ul></li><li><a href=/docs/example/shortcodes/buttons/>Buttons</a></li><li><a href=/docs/example/shortcodes/columns/>Columns</a></li><li><a href=/docs/example/shortcodes/details/>Details</a></li><li><a href=/docs/example/shortcodes/expand/>Expand</a></li><li><a href=/docs/example/shortcodes/hints/>Hints</a></li><li><a href=/docs/example/shortcodes/tabs/>Tabs</a></li></ul></li></ul><ul><li><a href=/posts/>Blog</a></li></ul></nav><script>(function(){var e=document.querySelector("aside .book-menu-content");addEventListener("beforeunload",function(){localStorage.setItem("menu.scrollTop",e.scrollTop)}),e.scrollTop=localStorage.getItem("menu.scrollTop")})()</script></div></aside><div class=book-page><header class=book-header><div class="flex align-center justify-between"><label for=menu-control><img src=/svg/menu.svg class=book-icon alt=Menu>
</label><strong>Ubuntu</strong>
<label for=toc-control><img src=/svg/toc.svg class=book-icon alt="Table of Contents"></label></div><aside class="hidden clearfix"><nav id=TableOfContents><ul><li><a href=#firefox>Firefox</a><ul><li><a href=#1-添加firefox到favorites喜爱应用>1. 添加Firefox到Favorites（喜爱应用）</a></li><li><a href=#2-检查desktop文件是否正确>2. 检查.desktop文件是否正确</a></li><li><a href=#3-更新缓存和重启可选---我用的-bef1ba>3. 更新缓存和重启(可选) - 我用的 [[#^bef1ba]]</a></li><li><a href=#4-手动创建desktop文件将软件添加到软件列表>4. 手动创建.desktop文件(将软件添加到软件列表)</a></li><li><a href=#5-检查默认应用设置>5. 检查默认应用设置</a></li></ul></li></ul><ul><li><a href=#如果是双系统可以软链一些通用目录节省空间>如果是双系统可以软链一些通用目录节省空间</a></li></ul><ul><li><a href=#一安装向日葵缺失libgconf-2-4>一、安装向日葵缺失<code>libgconf-2-4</code></a></li></ul><ul><li><a href=#登陆自启>登陆自启</a></li><li><a href=#配置详情>配置详情:</a></li></ul></nav></aside></header><article class=markdown><h1 id=snap>Snap
<a class=anchor href=#snap>#</a></h1><blockquote><p>如果<code>Ubuntu</code>有问题,那么很有可能是因为<code>Snap</code></p></blockquote><h2 id=firefox>Firefox
<a class=anchor href=#firefox>#</a></h2><p>在升级<code>Ubuntu 24.04</code>后内存占用极为不正常, 多次排查无果, 增加了交换空间还是没有治本, 几经排查终于发现是<code>firefox</code>的问题, 且是Snap的firefox的问题,所以手动下载别的版本后修改如下:</p><ul><li>修改<code>/usr/bin/firefox</code>中的最一开始的监测安装和运行为自行下载软件路径</li><li>添加<code>gnome favorite-apps</code></li></ul><h3 id=1-添加firefox到favorites喜爱应用>1. 添加Firefox到Favorites（喜爱应用）
<a class=anchor href=#1-%e6%b7%bb%e5%8a%a0firefox%e5%88%b0favorites%e5%96%9c%e7%88%b1%e5%ba%94%e7%94%a8>#</a></h3><ol><li>打开终端（Ctrl + Alt + T）。</li><li>输入以下命令来查看当前的喜爱应用列表：</li></ol><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>gsettings get org.gnome.shell favorite-apps
</span></span></code></pre></div><p>这会输出当前的喜爱应用列表
3. 如果没有看到 <code>firefox.desktop</code> 在列表中，可以使用以下命令将它添加进去,这个命令会将 <code>firefox.desktop</code> 添加到喜爱应用列表的末尾。：</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>gsettings set org.gnome.shell favorite-apps <span style=color:#e6db74>&#34;</span><span style=color:#66d9ef>$(</span>gsettings get org.gnome.shell favorite-apps | sed <span style=color:#e6db74>&#34;s/]/, &#39;firefox.desktop&#39;]/&#34;</span><span style=color:#66d9ef>)</span><span style=color:#e6db74>&#34;</span>
</span></span></code></pre></div><h3 id=2-检查desktop文件是否正确>2. 检查.desktop文件是否正确
<a class=anchor href=#2-%e6%a3%80%e6%9f%a5desktop%e6%96%87%e4%bb%b6%e6%98%af%e5%90%a6%e6%ad%a3%e7%a1%ae>#</a></h3><p>确保 <code>firefox.desktop</code> 文件存在并且正确配置。通常，它应该位于 <code>/usr/share/applications/</code> 目录或者在Snap安装中可能位于 <code>/var/lib/snapd/desktop/applications/</code> 目录。你可以使用 <code>ls</code> 命令检查这些位置是否有相关的 <code>.desktop</code> 文件：</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>ls /usr/share/applications/firefox.desktop
</span></span><span style=display:flex><span>ls /var/lib/snapd/desktop/applications/firefox_firefox.desktop  <span style=color:#75715e># 如果是通过Snap安装的Firefox`</span>
</span></span></code></pre></div><h3 id=3-更新缓存和重启可选---我用的-bef1ba>3. 更新缓存和重启(可选) - 我用的 [[#^bef1ba]]
<a class=anchor href=#3-%e6%9b%b4%e6%96%b0%e7%bc%93%e5%ad%98%e5%92%8c%e9%87%8d%e5%90%af%e5%8f%af%e9%80%89---%e6%88%91%e7%94%a8%e7%9a%84-bef1ba>#</a></h3><p>如果以上步骤没有解决问题，尝试更新GNOME的缓存并重新启动GNOME Shell：</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>sudo update-desktop-database
</span></span></code></pre></div><p>然后注销并重新登录GNOME Shell，看看是否能够显示Firefox图标。</p><h3 id=4-手动创建desktop文件将软件添加到软件列表>4. 手动创建.desktop文件(将软件添加到软件列表)
<a class=anchor href=#4-%e6%89%8b%e5%8a%a8%e5%88%9b%e5%bb%badesktop%e6%96%87%e4%bb%b6%e5%b0%86%e8%bd%af%e4%bb%b6%e6%b7%bb%e5%8a%a0%e5%88%b0%e8%bd%af%e4%bb%b6%e5%88%97%e8%a1%a8>#</a></h3><p>^bef1ba</p><p>如果 <code>.desktop</code> 文件确实存在但仍然无法正常显示图标，可以尝试手动创建一个 <code>.desktop</code> 文件。创建一个名为 <code>firefox.desktop</code> 的文件，并将以下内容复制粘贴进去：</p><pre tabindex=0><code class=language-desktop data-lang=desktop>[Desktop Entry]
Version=1.0
Name=Firefox
Comment=Browse the World Wide Web
GenericName=Web Browser
Keywords=Internet;WWW;Browser;Web;Explorer
Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=New Window
Exec=firefox --new-window %u

[Desktop Action new-private-window]
Name=New Private Window
Exec=firefox --private-window %u
</code></pre><p>保存文件后，将其放置在 <code>/usr/share/applications/</code> 目录下，并确保具有适当的文件权限。</p><h3 id=5-检查默认应用设置>5. 检查默认应用设置
<a class=anchor href=#5-%e6%a3%80%e6%9f%a5%e9%bb%98%e8%ae%a4%e5%ba%94%e7%94%a8%e8%ae%be%e7%bd%ae>#</a></h3><p>最后，确保Firefox已经被正确设置为默认的Web浏览器。可以通过以下命令检查：
<code>xdg-settings get default-web-browser</code>
如果没有设置为 <code>firefox.desktop</code>，可以使用以下命令设置：
<code>xdg-settings set default-web-browser firefox.desktop</code>
完成上述步骤后，重新启动Firefox并检查是否显示了正确的图标和行为。希望这些步骤能帮助你解决在GNOME中Firefox图标未显示的问题！</p><h1 id=设置用户下中文目录为英文>设置用户下中文目录为英文
<a class=anchor href=#%e8%ae%be%e7%bd%ae%e7%94%a8%e6%88%b7%e4%b8%8b%e4%b8%ad%e6%96%87%e7%9b%ae%e5%bd%95%e4%b8%ba%e8%8b%b1%e6%96%87>#</a></h1><blockquote><p>每次cd切换输入法有些难受</p></blockquote><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>vim .config/user-dirs.dirs
</span></span></code></pre></div><h2 id=如果是双系统可以软链一些通用目录节省空间>如果是双系统可以软链一些通用目录节省空间
<a class=anchor href=#%e5%a6%82%e6%9e%9c%e6%98%af%e5%8f%8c%e7%b3%bb%e7%bb%9f%e5%8f%af%e4%bb%a5%e8%bd%af%e9%93%be%e4%b8%80%e4%ba%9b%e9%80%9a%e7%94%a8%e7%9b%ae%e5%bd%95%e8%8a%82%e7%9c%81%e7%a9%ba%e9%97%b4>#</a></h2><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>ln -s /mnt/Windows/Users/<span style=color:#f92672>{</span>用户名<span style=color:#f92672>}</span>/Downloads /home/<span style=color:#f92672>{</span>用户名<span style=color:#f92672>}</span>/Downloads
</span></span></code></pre></div><h1 id=文件管理器>文件管理器
<a class=anchor href=#%e6%96%87%e4%bb%b6%e7%ae%a1%e7%90%86%e5%99%a8>#</a></h1><p><code>nautilus</code></p><h1 id=apt>apt
<a class=anchor href=#apt>#</a></h1><p> Ubuntu 中，使用 <code>apt-get install</code> 或 <code>apt install</code> 下载并安装软件时，相关文件存储在以下位置：</p><ul><li>软件包：<code>/var/cache/apt/archives</code></li><li>安装位置：<code>/usr/share</code></li><li>快捷方式：<code>/usr/share/applications</code></li><li>可执行文件：<code>/usr/bin</code></li><li>库文件：<code>/usr/lib</code></li><li>配置文件：<code>/etc</code></li></ul><h1 id=依赖包缺失>依赖包缺失
<a class=anchor href=#%e4%be%9d%e8%b5%96%e5%8c%85%e7%bc%ba%e5%a4%b1>#</a></h1><h2 id=一安装向日葵缺失libgconf-2-4>一、安装向日葵缺失<code>libgconf-2-4</code>
<a class=anchor href=#%e4%b8%80%e5%ae%89%e8%a3%85%e5%90%91%e6%97%a5%e8%91%b5%e7%bc%ba%e5%a4%b1libgconf-2-4>#</a></h2><blockquote><p><a href=https://blog.csdn.net/lingzhou0909/article/details/139708197>https://blog.csdn.net/lingzhou0909/article/details/139708197</a></p></blockquote><ol><li>去<code>https://packages.ubuntu.com/search?keywords=libgconf-2-4</code>查看版本</li><li>发现没有<code>24.04</code>版的, 将<code>22.04</code>版本的加到 <code>source.list</code> 中</li><li><code>apt update</code></li><li><code>sudo apt --fix-broken install</code></li><li><code>dpkg -i SunloginClient_15.2.0.63062_amd64.deb</code> 再次安装</li></ol><h1 id=desktop-程序开发>.desktop 程序开发
<a class=anchor href=#desktop-%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91>#</a></h1><blockquote><p>自动启动配置: ~/.config/autostart/
注册到应用中: /usr/share/applications/</p></blockquote><h2 id=登陆自启>登陆自启
<a class=anchor href=#%e7%99%bb%e9%99%86%e8%87%aa%e5%90%af>#</a></h2><blockquote><p>不过现在好多应用貌似都没放在这里, 就老牌的应用有放.<br>不过这里貌似是很正规的地方, 毕竟在Ubuntu"启动应用程序"里可以看到这个配置</p></blockquote><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>sudo cp ~/.config/autostart/desktop-tools.desktop /usr/share/applications/
</span></span></code></pre></div><h2 id=配置详情>配置详情:
<a class=anchor href=#%e9%85%8d%e7%bd%ae%e8%af%a6%e6%83%85>#</a></h2><table><thead><tr><th>配置</th><th>说明</th><th>其他</th></tr></thead><tbody><tr><td>Path</td><td>工作目录</td><td></td></tr></tbody></table><pre tabindex=0><code class=language-desktop data-lang=desktop>[Desktop Entry]
Name=desktoptools
Name[zh_CN]=桌面工具
Comment=Desktop Tools
Comment[zh_CN]=桌面工具
GenericName=Desktop Tools
Keywords=tools
Exec=/home/ian/env/ui/bin/python test.py %u
Path=/home/ian/Apps/DesktopTools
Icon=/home/ian/Apps/DesktopTools/DesktopTools/harry_potter.png
Terminal=false
Type=Application
X-GNOME-Autostart-Delay=10
Categories=GNOME;Utility;
Hidden=false
</code></pre></article><footer class=book-footer><div class="flex flex-wrap justify-between"></div><script>(function(){function e(e){const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}document.querySelectorAll("pre code").forEach(t=>{t.addEventListener("click",function(){if(window.getSelection().toString())return;e(t.parentElement),navigator.clipboard&&navigator.clipboard.writeText(t.parentElement.textContent)})})})()</script></footer><div class=book-comments></div><label for=menu-control class="hidden book-menu-overlay"></label></div><aside class=book-toc><div class=book-toc-content><nav id=TableOfContents><ul><li><a href=#firefox>Firefox</a><ul><li><a href=#1-添加firefox到favorites喜爱应用>1. 添加Firefox到Favorites（喜爱应用）</a></li><li><a href=#2-检查desktop文件是否正确>2. 检查.desktop文件是否正确</a></li><li><a href=#3-更新缓存和重启可选---我用的-bef1ba>3. 更新缓存和重启(可选) - 我用的 [[#^bef1ba]]</a></li><li><a href=#4-手动创建desktop文件将软件添加到软件列表>4. 手动创建.desktop文件(将软件添加到软件列表)</a></li><li><a href=#5-检查默认应用设置>5. 检查默认应用设置</a></li></ul></li></ul><ul><li><a href=#如果是双系统可以软链一些通用目录节省空间>如果是双系统可以软链一些通用目录节省空间</a></li></ul><ul><li><a href=#一安装向日葵缺失libgconf-2-4>一、安装向日葵缺失<code>libgconf-2-4</code></a></li></ul><ul><li><a href=#登陆自启>登陆自启</a></li><li><a href=#配置详情>配置详情:</a></li></ul></nav></div></aside></main></body></html>